<%@page import="java.io.*,java.net.*;"%>
<%
if(request.getParameter("file") != null) {
	if(request.getProtocol().equals("HTTP/1.0"))
	response.setHeader("Pragma","no-cache");
	else
	response.setHeader("Cache-Control","no-cache");
	 String afile = request.getParameter("file");
  	response.setHeader ("Content-Disposition", "attachment;filename=\""+request.getParameter("fileName")+"\"");
	 response.setContentType("multipart/form-data"); 
	response.setHeader("Expires","0");

		File f = new File(request.getParameter("file"));
		InputStream in = new FileInputStream(f);
		ServletOutputStream outs = response.getOutputStream();
		int bit = 256;
		int i = 0;
    		try {
        			while ((bit) >= 0) {
        				bit = in.read();
        				outs.write(bit);
        			}
            		} catch (IOException ioe) {
            			ioe.printStackTrace(System.out);
            		}
            		outs.flush();
            		outs.close();
            		in.close();	

}
%>            